Paradigm(s) | multi-paradigm: declarative, imperative |
---|---|
Appeared in | 1985 |
Designed by | Robert Fourer David Gay Brian Kernighan Bell Labs |
Stable release | 20110531 (May 31, 2011) |
Influenced by | AWK, C |
OS | Cross-platform (multi-platform) |
License | Proprietary (translator), free and open-source (AMPL Solver Library) |
Usual filename extensions | .mod .dat .run |
Website | www.ampl.com |
AMPL, an acronym for "A Mathematical Programming Language", is an algebraic modeling language for describing and solving high-complexity problems for large-scale mathematical computation (i.e. large-scale optimization and scheduling-type problems). [1] It was developed by Robert Fourer, David Gay and Brian Kernighan at Bell Laboratories. AMPL supports dozens of solvers, both open source and commercial, including CBC, CPLEX, FortMP, Gurobi, MINOS, IPOPT, SNOPT and KNITRO. Problems are passed to solvers as nl files. AMPL is used by more than a hundred corporate clients. It is also used by government agencies and academic institutions.[2]
One particular advantage of AMPL is the similarity of its syntax to the mathematical notation of optimization problems. This allows for a very concise and readable definition of problems in the domain of optimization. Many modern solvers available on the NEOS [3] server hosted at the Argonne National Laboratory accept AMPL input. According to the NEOS statistics AMPL is the most popular format for representing mathematical programming problems.
Contents |
AMPL features a mixture of declarative and imperative programming styles. Formulation of optimization models takes place through declarative language elements such as sets, scalar and multidimensional parameters, decision variables, objectives and constraints, which allow for a concise description of most problems in the domain of mathematical optimization.
Procedures and control flow statements are available in AMPL for
To support re-use and simplify construction of large-scale optimization problems, AMPL allows separation of model and data.
AMPL supports a wide range of problem types, among them:
AMPL invokes a solver in a separate process which has the following advantages:
Interaction with the solver is done through a well-defined nl interface.
AMPL is available for many popular 32- and 64-bit platforms including Linux, Mac OS X and Windows. The translator itself is a proprietary software currently maintained by AMPL Optimization LLC. However there exist several online services [3][4] providing free modeling and solving facilities using AMPL. Also a free student version with limited functionality is available.[5]
The AMPL Solver Library (ASL) which allows to read the nl files and provides the automatic differentiation functionality is open-source. It is used in many solvers to implement AMPL connection.
This table present significant steps in AMPL history.
Year | Highlights |
---|---|
1985 | AMPL was designed and implemented [1] |
1990 | Paper describing the AMPL modeling language was published in Management Science[6] |
1991 | AMPL supports nonlinear programming and automatic differentiation |
1993 | Robert Fourer, David Gay and Brian Kernighan were awarded ORSA/CSTS Prize [7] by the Operations Research Society of America, for writings on the design of mathematical programming systems and the AMPL modeling language |
1995 | Extensions for representing piecewise-linear and network structures |
1995 | Scripting constructs |
1997 | Enhanced support for nonlinear solvers |
1998 | AMPL supports complementarity problems |
2000 | Relational database and spreadsheet access |
2005 | AMPL Modeling Language Google group opened [8] |
2008 | Kestrel: An AMPL Interface to the NEOS Server introduced |
A transportation problem from George Dantzig is used to provide a sample AMPL model. This problem finds the least cost shipping schedule that meets requirements at markets and supplies at factories.
Dantzig, G B, Chapter 3.3. In Linear Programming and Extensions. Princeton University Press, Princeton, New Jersey, 1963.
set Plants; set Markets; # Capacity of plant p in cases param Capacity{p in Plants}; # Demand at market m in cases param Demand{m in Markets}; # Distance in thousands of miles param Distance{Plants, Markets}; # Freight in dollars per case per thousand miles param Freight; # Transport cost in thousands of dollars per case param TransportCost{p in Plants, m in Markets} = Freight * Distance[p, m] / 1000; # Shipment quantities in cases var shipment{Plants, Markets} >= 0; # Total transportation costs in thousands of dollars minimize cost: sum{p in Plants, m in Markets} TransportCost[p, m] * shipment[p, m]; # Observe supply limit at plant p s.t. supply{p in Plants}: sum{m in Markets} shipment[p, m] <= Capacity[p]; # Satisfy demand at market m s.t. demand{m in Markets}: sum{p in Plants} shipment[p, m] >= Demand[m]; data; set Plants := seattle san-diego; set Markets := new-york chicago topeka; param Capacity := seattle 350 san-diego 600; param Demand := new-york 325 chicago 300 topeka 275; param Distance : new-york chicago topeka := seattle 2.5 1.7 1.8 san-diego 2.5 1.8 1.4; param Freight := 90;